<template>
  <div class="wrapper">
    <com-table>
      <table class="table">
        <tr>
          <th>在投金额</th>
          <th>待收利息</th>
          <th>累计收益</th>
          <th>累计投资金额</th>
        </tr>
        <template v-if="tyj.length > 0">
          <tr v-for="(item, index) in tyj" :key="index">
            <td v-text="item.InvestmentAmount"></td>
            <td v-text="item.Interest"></td>
            <td v-text="item.TotalInterest"></td>
            <td v-text="item.TotalAmount"></td>
          </tr>
        </template>
      </table>
    </com-table>
    <p v-if="tyj.length === 0" :class="$style.empty">暂无记录</p>
  </div>
</template>
<script>
import ComTable from '../../../../../components/comTable'

export default {
  name: 'dialog5',
  data(){
    return {
      tyj: []
    }
  },
  components: {
    ComTable,
  },
  mounted(){
    this.getTyj()
  },
  methods: {
    async getTyj() {
      try{
        const {leadInMsg} = this.$store.getters.callMsg
        const fUid = leadInMsg.id
        if(fUid === undefined){
          return
        }
        const {data} = await this.$get(this,{
          api:'member/experienceMoney.do',
          data:{
            fUid
          }
        })
        const tmpa = []
        if(data.state === 0){
          data.content ? tmpa.push(data.content) : tmpa
          this.tyj = tmpa
          return
        }
      }catch(e){
        this.$warn('系统member/experienceMoney.do接口报错')
      }
    }
  }
}
</script>

<style lang="scss" module>
.empty{
  padding:15px;
  text-align:center;
}
.textRight{
  text-align:right;
}
</style>
